package com.xkdx.guangguang.fragment.user;

import java.util.HashMap;

import android.support.v4.app.FragmentManager;

import com.xkdx.guangguang.UserActivity;
import com.xkdx.guangguang.fragment.BaseFragment;
import com.xkdx.guangguang.module.network.AbsModule;
import com.xkdx.guangguang.module.network.HttpTask;
import com.xkdx.guangguang.module.network.IOHttpRequest;
import com.xkdx.guangguang.module.network.IOHttpTask;
import com.xkdx.guangguang.module.network.JsonHttpRequest;
import com.xkdx.guangguang.module.statics.IConstants;

public class UserLoginSinaPresenter extends IOHttpTask {

	public UserLoginSinaPresenter(BaseFragment context) {
		this.baseFragment = context;
		this.connectTimeout = 3000;
		this.soTimeOut = 3000;
		requestInstent = new IOHttpRequest();
		mUseCache = false;
	}

	@Override
	protected void onPostExecute(HashMap<String, AbsModule> result) {

		if (baseFragment != null) {

			// 注释部分对于层次嵌套fragment报空指针 zs
			// ((UserRegisteFragment) ((UserActivity) context)
			// .getuserRegistFragment()).showLoaded(result);
			FragmentManager fm = ((UserActivity) baseFragment.getActivity())
					.getSupportFragmentManager();
			UserLoginFragment userLoginFragment = (UserLoginFragment) fm
					.findFragmentByTag("userLoginFragment");
			userLoginFragment.showTencentLoaded(result);
		}
	}

}
